<%@ page import="com.ws.haungjia.utils.Res" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>商品分类</title>
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      font-family: 'Arial', sans-serif;
    }

    body {
      background-color: #f5f5f5;
      color: #333;
    }

    .container {
      max-width: 1200px;
      margin: 0 auto;
      padding: 20px;
    }

    .header {
      text-align: center;
      margin-bottom: 30px;
    }

    .header h1 {
      font-size: 2.5rem;
      color: #2c3e50;
    }

    .search-bar {
      display: flex;
      justify-content: center;
      margin-bottom: 30px;
    }

    .search-bar input {
      width: 60%;
      padding: 12px 20px;
      border: 1px solid #ddd;
      border-radius: 25px;
      font-size: 1rem;
      outline: none;
    }

    .search-bar button {
      padding: 12px 20px;
      margin-left: 10px;
      background-color: #3498db;
      color: white;
      border: none;
      border-radius: 25px;
      cursor: pointer;
      font-size: 1rem;
      transition: background-color 0.3s;
    }

    .search-bar button:hover {
      background-color: #2980b9;
    }

    .category-container {
      display: flex;
      flex-wrap: wrap;
      gap: 20px;
      justify-content: center;
    }

    .category-card {
      background-color: white;
      border-radius: 10px;
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
      width: 280px;
      overflow: hidden;
      transition: transform 0.3s, box-shadow 0.3s;
    }

    .category-card:hover {
      transform: translateY(-5px);
      box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    }

    .category-image {
      height: 180px;
      overflow: hidden;
    }

    .category-image img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      transition: transform 0.5s;
    }

    .category-card:hover .category-image img {
      transform: scale(1.05);
    }

    .category-info {
      padding: 20px;
    }

    .category-info h3 {
      font-size: 1.3rem;
      margin-bottom: 10px;
      color: #2c3e50;
    }

    .category-info p {
      color: #7f8c8d;
      margin-bottom: 15px;
      line-height: 1.5;
    }

    .category-info a {
      display: inline-block;
      padding: 8px 15px;
      background-color: #3498db;
      color: white;
      text-decoration: none;
      border-radius: 5px;
      transition: background-color 0.3s;
    }

    .category-info a:hover {
      background-color: #2980b9;
    }

    .filter-section {
      background-color: white;
      padding: 20px;
      border-radius: 10px;
      margin-bottom: 30px;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    .filter-section h2 {
      margin-bottom: 15px;
      color: #2c3e50;
    }

    .filter-options {
      display: flex;
      flex-wrap: wrap;
      gap: 15px;
    }

    .filter-group {
      flex: 1;
      min-width: 200px;
    }

    .filter-group h3 {
      font-size: 1rem;
      margin-bottom: 10px;
      color: #7f8c8d;
    }

    .filter-option {
      margin-bottom: 8px;
    }

    .filter-option label {
      margin-left: 5px;
      cursor: pointer;
    }

    @media (max-width: 768px) {
      .category-card {
        width: 100%;
      }

      .search-bar input {
        width: 100%;
      }

      .search-bar {
        flex-direction: column;
        align-items: center;
      }

      .search-bar button {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
      }
    }
  </style>
</head>
<body>
<div class="container">
  <div class="header">
    <h1>商品分类</h1>
    <p>浏览我们的各类商品</p>
  </div>

  <div class="search-bar">
    <input type="text" placeholder="搜索分类...">
    <button>搜索</button>
  </div>

<%--  <div class="filter-section">--%>
<%--    <h2>筛选条件</h2>--%>
<%--    <div class="filter-options">--%>
<%--      <div class="filter-group">--%>
<%--        <h3>价格范围</h3>--%>
<%--        <div class="filter-option">--%>
<%--          <input type="checkbox" id="price1">--%>
<%--          <label for="price1">¥0 - ¥100</label>--%>
<%--        </div>--%>
<%--        <div class="filter-option">--%>
<%--          <input type="checkbox" id="price2">--%>
<%--          <label for="price2">¥100 - ¥500</label>--%>
<%--        </div>--%>
<%--        <div class="filter-option">--%>
<%--          <input type="checkbox" id="price3">--%>
<%--          <label for="price3">¥500以上</label>--%>
<%--        </div>--%>
<%--      </div>--%>

<%--      <div class="filter-group">--%>
<%--        <h3>品牌</h3>--%>
<%--        <div class="filter-option">--%>
<%--          <input type="checkbox" id="brand1">--%>
<%--          <label for="brand1">品牌A</label>--%>
<%--        </div>--%>
<%--        <div class="filter-option">--%>
<%--          <input type="checkbox" id="brand2">--%>
<%--          <label for="brand2">品牌B</label>--%>
<%--        </div>--%>
<%--        <div class="filter-option">--%>
<%--          <input type="checkbox" id="brand3">--%>
<%--          <label for="brand3">品牌C</label>--%>
<%--        </div>--%>
<%--      </div>--%>

<%--      <div class="filter-group">--%>
<%--        <h3>排序方式</h3>--%>
<%--        <div class="filter-option">--%>
<%--          <input type="radio" name="sort" id="sort1" checked>--%>
<%--          <label for="sort1">默认排序</label>--%>
<%--        </div>--%>
<%--        <div class="filter-option">--%>
<%--          <input type="radio" name="sort" id="sort2">--%>
<%--          <label for="sort2">价格从低到高</label>--%>
<%--        </div>--%>
<%--        <div class="filter-option">--%>
<%--          <input type="radio" name="sort" id="sort3">--%>
<%--          <label for="sort3">价格从高到低</label>--%>
<%--        </div>--%>
<%--      </div>--%>
<%--    </div>--%>
<%--  </div>--%>

  <div class="category-container">
    <c:forEach items="${fenlie}" var="item">
    <div class="category-card">
      <div class="category-image">
        <img src="<%=Res.fileUri%>${item.zhutu}"  alt="电子产品">
      </div>
      <div class="category-info">
        <h3>${item.name}</h3>
        <p>价格:${item.jiage}</p>
        <a href="${ pageContext.request.contextPath}/qianhou/xiangxiye?packageID=${item.packageID}">查看详情</a>
      </div>
    </div>
    </c:forEach>

<%--    <div class="category-card">--%>
<%--      <div class="category-image">--%>
<%--        <img src="https://via.placeholder.com/300x200?text=服装" alt="服装">--%>
<%--      </div>--%>
<%--      <div class="category-info">--%>
<%--        <h3>服装</h3>--%>
<%--        <p>男女装、童装、运动服饰等</p>--%>
<%--        <a href="#">查看详情</a>--%>
<%--      </div>--%>
<%--    </div>--%>

<%--    <div class="category-card">--%>
<%--      <div class="category-image">--%>
<%--        <img src="https://via.placeholder.com/300x200?text=家居用品" alt="家居用品">--%>
<%--      </div>--%>
<%--      <div class="category-info">--%>
<%--        <h3>家居用品</h3>--%>
<%--        <p>家具、家纺、厨具等家居产品</p>--%>
<%--        <a href="#">查看详情</a>--%>
<%--      </div>--%>
<%--    </div>--%>

<%--    <div class="category-card">--%>
<%--      <div class="category-image">--%>
<%--        <img src="https://via.placeholder.com/300x200?text=食品" alt="食品">--%>
<%--      </div>--%>
<%--      <div class="category-info">--%>
<%--        <h3>食品</h3>--%>
<%--        <p>零食、生鲜、饮料等各类食品</p>--%>
<%--        <a href="#">查看详情</a>--%>
<%--      </div>--%>
<%--    </div>--%>

<%--    <div class="category-card">--%>
<%--      <div class="category-image">--%>
<%--        <img src="https://via.placeholder.com/300x200?text=美妆" alt="美妆">--%>
<%--      </div>--%>
<%--      <div class="category-info">--%>
<%--        <h3>美妆</h3>--%>
<%--        <p>护肤品、化妆品、个人护理等</p>--%>
<%--        <a href="#">查看详情</a>--%>
<%--      </div>--%>
<%--    </div>--%>

<%--    <div class="category-card">--%>
<%--      <div class="category-image">--%>
<%--        <img src="https://via.placeholder.com/300x200?text=图书" alt="图书">--%>
<%--      </div>--%>
<%--      <div class="category-info">--%>
<%--        <h3>图书</h3>--%>
<%--        <p>各类书籍、杂志、电子书等</p>--%>
<%--        <a href="#">查看详情</a>--%>
<%--      </div>--%>
<%--    </div>--%>
  </div>
</div>
</body>
</html>